package com.laoma.stockcenter.common;

import com.laoma.ordercenter.common.Constants;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

/**
 * @program: szwfj-weixin-work
 * @description:
 * @author: 老马
 * @create: 2018-07-10 14:16
 **/
@Data
@AllArgsConstructor
@NoArgsConstructor
public class CommonException extends Exception {

    protected String code ;
    protected String message;


    public static CommonException buildCommonException(String code, String errorMsg) {
        return new CommonException(code, errorMsg);
    }

    public static CommonException buildCommonException(String errorMsg) {
        return new CommonException(""+ Constants.COMMON_RESPONSE_CODE_ERROR, errorMsg);
    }
}
